﻿<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<html>
<head>
	<%
		String alarmIds = request.getParameter("alarmIds");
	%>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript">
		$(document).ready(function(){
			var baseParams = {alarmIds:<%=alarmIds%>};
			var EXT_QUERY_TIME_OUT = 1200000;
			var alarmQueryStore;
			
			alarmQueryStore = new Ext.data.JsonStore({
		        url: '${pageContext.request.contextPath}/getAlarmQuery.action',
		        root: 'datas',
				timeout : EXT_QUERY_TIME_OUT,
		        fields: ['id','snumbe','tel','calltime','answertime','disposition','endtime'],
		        baseParams: baseParams,
		        idProperty:'id',//唯一标识(如果不设定唯一标识,则多行记录只会显示一行记录)
		        autoLoad: true
		    });
		    
             // 用户数据表格
			var alarmQueryGrid = new Ext.grid.GridPanel({
				id: 'alarmQueryGrid',
				renderTo: 'alarmQueryGridDiv',
				border: false,
				stateful: true,
			    autoScroll: 'auto',
		        store: alarmQueryStore,
		        loadMask: true,
		        cm: new Ext.grid.ColumnModel({
		            defaults: {
		                width: 100,
		                sortable: true
		            },
			        columns: [
						new Ext.grid.RowNumberer({header:'№',width:50}),
						{id:'id',header: '用户ID', width: 100, hidden: true, sortable: true, dataIndex: 'id'},
			            {id:'snumbe',header: '流水号', width: 100, sortable: true, dataIndex: 'snumbe'},
			            {id:'tel',header: '电话', width: 100, sortable: true, dataIndex: 'tel'},
			            {id:'calltime',header: '拨打时间', width: 150, sortable: true, dataIndex: 'calltime'},
			            {id:'answertime',header: '应答时间', width: 150, sortable: true, dataIndex: 'answertime'},
			            {id:'disposition',header: '是否接听', width: 100, sortable: true, dataIndex: 'disposition'},
			            {id:'endtime',header: '结束时间', width: 150, sortable: true, dataIndex: 'endtime'}
					]
		        }),
		        columnLines: true
		    });
		    
		    // 设置Grid高度和宽度
		    Anynote.resizeGridTo("alarmQueryGrid", 0, 56);
		    
		 	// 取消按钮
		    $("#alarmQuery-cancel-button").click(function(){
		    	Ext.getCmp("buttonType").setValue("cancel");
		    	searchAlarmWindow.close();
			});
		});
	</script>
</head>
<body> 
<div id="alarmQueryDiv" style="width:100%;height:100%;">
<div id="alarmQueryGridDiv"></div>
</div>
</body>
</html>